﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;

/// <summary>
/// Summary description for datMatKhau
/// </summary>
public class datMatKhau
{
	public datMatKhau()
	{
		//
		// TODO: Add constructor logic here
		//
	}
      SqlCommand cmd;
        SqlDataReader dr;
        public void creat(string masv, string keyurl)
        {
            string constr = System.Configuration.ConfigurationManager.ConnectionStrings["conStr3"].ConnectionString;
            SqlConnection sqlConnection = new SqlConnection(constr);
            sqlConnection.Open();
            cmd = new SqlCommand("sp_MatKhauCreate", sqlConnection);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlParameter[] sqla = new SqlParameter[2];
            sqla[0] = new SqlParameter("masinhvien", DbType.String);
            sqla[1] = new SqlParameter("keyurl", DbType.String);


            sqla[0].Value = masv;
            sqla[1].Value = keyurl;
            cmd.Parameters.AddRange(sqla);
            cmd.ExecuteNonQuery();
            sqlConnection.Close();
        }
        public void reset(string masv, string keyurl)
        {
            string constr = System.Configuration.ConfigurationManager.ConnectionStrings["conStr"].ConnectionString;
            SqlConnection sqlConnection = new SqlConnection(constr);
            sqlConnection.Open();
            cmd = new SqlCommand("sp_MatKhaureset", sqlConnection);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlParameter[] sqla = new SqlParameter[2];
            sqla[0] = new SqlParameter("masinhvien", DbType.String);
            sqla[1] = new SqlParameter("keyurl", DbType.String);


            sqla[0].Value = masv;
            sqla[1].Value = keyurl;
            cmd.Parameters.AddRange(sqla);
            cmd.ExecuteNonQuery();
            sqlConnection.Close();
        }
}